package com.isoft.systemprovidor.controller.perinfor;

import com.isoft.systemprovidor.bean.ResponseData;
import com.isoft.systemprovidor.controller.BaseController;
import com.isoft.systemprovidor.entity.perinfor.Perinfor_Basic;
import com.isoft.systemprovidor.entity.perinfor.Perinfor_Relative_relativesoccupation;
import com.isoft.systemprovidor.service.perinfor.Perinfor_Relative_Relativesoccupation_Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/systemprovidor/relativesoccupation")
public class Perinfor_Relative_Relativesoccupation_Controller extends BaseController {
    @Autowired
    Perinfor_Relative_Relativesoccupation_Service service;
    /*验证身份证号*/
    @GetMapping("/idcardisexist")
    public ResponseData idcardIsExist(String idcard){
        return service.idcardIsExist(idcard);
    }

    /*查看我的亲属从事相关职业*/
    @GetMapping("/get")
    public ResponseData selectRelativesoccupation(String sysuserid){
        return service.selectRelativesoccupation(sysuserid);
    }
    /*修改我的亲属从事相关职业*/
    @PutMapping("/update")
    public ResponseData<Boolean> changeRelativesoccupation( @RequestBody Perinfor_Relative_relativesoccupation relativesoccupation){
        return returnBoolean(service.changeRelativesoccupation(relativesoccupation));
    }
    /*添加我的亲属从事相关职业*/
    @PostMapping("/add")
    public ResponseData<Object> insertRelativesoccupation(Perinfor_Relative_relativesoccupation relativesoccupation){
        return returnObject(service.insertRelativesoccupation(relativesoccupation));
    }
    /*删除我的亲属从事相关职业*/
    @DeleteMapping("/delete")
    public ResponseData<Boolean> deleteRelativesoccupation(Integer id ,String sysuserid){
        return returnBoolean(service.deleteRelativesoccupation(id , sysuserid));
    }
}
